<!DOCTYPE html>
<head>
    {include file='public_file/header' /}
    <script>
        $(function(){
            $("#navcid_select").change(function() {
                $("#mainform").submit();
            });
        })
    </script>
</head>
<body>
<div class="container-fluid">
    {include file='public_file/nav_tabs' /}

    <form class="well form-search" id="mainform" action="{:url('extended/index')}" method="get">
        <div class="btn-group width2">
            <?=\app\common\tool\Tool::get('form')->select(
            'groups',
            array_merge([0 => '全部模型'], $groups),
            input('groups'),
            ['class' => 'form-control', 'id' => 'navcid_select' ]
            )?>
        </div>
    </form>
    <form  method="post">
        <table class="table table-hover table-bordered table-list" id="menus-table">
            <thead>
            <tr>
                <th width="50">ID</th>
                <th>标题</th>
                <th>类型</th>
                <th width="180">操作</th>
            </tr>
            </thead>
            <tbody>
            {foreach name='$list' item='v' }
            <tr>
                <th width="50">{$v.extended_id}</th>
                <th>{$v.title}</th>
                <th>{$groups[$v['group']]}</th>
                <th>
                    {if condition='$v["group"] == 2'}
                        <a href="{:url('extended/dataTypeEdit', ['id'=>$v['extended_id']])}">编辑</a> |
                    {else /}
                        <a href="{:url('extended/fieldsTypeEdit', ['id'=>$v['extended_id']])}">编辑</a> |
                    {/if}
                    <a class="a-post" post-msg="你确定删除吗?" post-url="{:url('extended/delete', ['id'=>$v['extended_id']])}">删除</a>
                </th>
            </tr>
            {/foreach}
            </tbody>
        </table>
    </form>
    <div class="text-center">
        {$page}
    </div>
</div>
{include file='public_file/footer' /}
</body>
</html>
